﻿//-----------------------------------------------------------------------
// <copyright file="WebAppPortfolio.cs" company="deixei.com">
//     Copyright (c) deixei.com. All rights reserved.
// </copyright>
// <author>Marcio Parente</author>
//---------------------------------------------------------------------
namespace Deixei.Domain
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Web.Script.Serialization;

    public class WebAppPortfolio : IDomainEntity, IArchivable, IAuditable
    {
        [Key]
        [Display(Name = "Id")]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required(ErrorMessage = "Application Name is required.")]
        [Display(Name = "Name", Description = "Web Application Name")]
        public string Name { get; set; }

        [Display(Name = "Description", Description = "Web Application Name description, what is the purpose of this web app. ", ShortName = "Descp.")]
        public string Description { get; set; }

        [Display(Name = "Url", Description = "Link to this web application.", ShortName = "Url")]
        public string Url { get; set; }

        [ScriptIgnore]
        [Display(Name = "Navigation Areas", Description = "List of Navigation Areas for this web application. Areas Menu options", ShortName = "Areas")]
        public virtual ICollection<NavigationArea> Areas { get; set; }
        
        [ScriptIgnore]
        [Display(Name = "Users", Description = "List of Users for this web application.", ShortName = "Usrs")]
        public virtual ICollection<User> Users { get; set; }

        /// <summary>
        /// Archivable Region
        /// </summary>
        [Display(Name = "Deleted By", Description = "Username of the user that deleted this item.", ShortName = "Del.By")]
        public string DeletedBy { get; set; }

        [Display(Name = "Deleted Date", Description = "Date of when this item was deleted.", ShortName = "Del.Dt")]
        public DateTime? Deleted { get; set; }

        /// <summary>
        /// Auditable Region
        /// </summary>
        [Display(Name = "Created By", Description = "Username of the user that firts registered this item.", ShortName = "Crt.By")]
        public string CreatedBy { get; set; }
        
        [Display(Name = "Created Date", Description = "Date of when this item was firts registered.", ShortName = "Crt.Dt")]
        public DateTime Created { get; set; }

        [Display(Name = "Updated By", Description = "Username of the user that last changed this item.", ShortName = "Upd.By")]
        public string UpdatedBy { get; set; }

        [Display(Name = "Updated Date", Description = "Date of when this item was last changed.", ShortName = "Upd.Dt")]
        public DateTime? Updated { get; set; }
    }
}
